# Maintainer: Kyle Keen <keenerd@gmail.com>
# Maintainer: Bruno Pagani <archange@archlinux.org>
# Creator: Peter Feigl <craven@gmx.net>
# Modified: Josh Kropf <josh@slashdev.ca>

pkgbase=teensy-loader-cli
pkgname=teensy_loader_cli
pkgver=2.2
pkgrel=2
pkgdesc="Command line loader for the teensy microprocessor boards"
arch=(loong64 x86_64)
url="https://www.pjrc.com/teensy/loader_cli.html"
license=(GPL2)
depends=(libusb-compat)
provides=(${pkgbase})
conflicts=(${pkgbase})
replaces=(${pkgbase})
source=(https://github.com/PaulStoffregen/${pkgname}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz
        https://www.pjrc.com/teensy/00-teensy.rules)
sha256sums=('103c691f412d04906c4f46038c234d3e5f78322c1b78ded102df9f900724cd54'
            '17f56b63603271e2cdae291fed347b66dfbdfd089b2847cf0b4383c877ffacfb')

build() {
  cd ${pkgname}-${pkgver}
  make
}

package() {
  cd ${pkgname}-${pkgver}
  install -Dm755 ${pkgname} -t "${pkgdir}"/usr/bin/
  install -Dm644 "${srcdir}"/00-teensy.rules -t "${pkgdir}"/usr/lib/udev/rules.d/
}
